package jrdcom.com.jrdcommonknowledge.Fragments.Serialize;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by longcheng on 2017/3/28.
 */

public class ParPerson implements Parcelable {
    String name;
    int age;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeInt(this.age);
    }

    public ParPerson() {
    }

    protected ParPerson(Parcel in) {
        this.name = in.readString();
        this.age = in.readInt();
    }

    public static final Parcelable.Creator<ParPerson> CREATOR = new Parcelable.Creator<ParPerson>() {
        @Override
        public ParPerson createFromParcel(Parcel source) {
            return new ParPerson(source);
        }

        @Override
        public ParPerson[] newArray(int size) {
            return new ParPerson[size];
        }
    };
}
